using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;
using CreamX.Framework.Game;
using CreamX.Framework.GameState.Screens;
using CreamX.Framework.GameState;
using CreamX.Framework.Game.GameEngine;
using CreamX.Framework.SceneGraph;
using CreamX.Framework.Game.Components;

namespace Copter
{
    public class Game1 : CreamXGame
    {
        public Game1()
        {
        }


        protected override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);
        }
        
        protected override void Initialize()
        {
            base.Initialize();
            
            
        }
        
        protected override void UnloadContent()
        {
            
            base.UnloadContent();
        }
        
        protected override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
        }

        public override void StartGame()
        {
            AddMenuItem(typeof(MainGameScreen), "Copter");
            
            
            base.StartGame();
        }

        void entry_Selected(object sender, EventArgs e)
        {
            Exit();
        }
        
        protected override void LoadContent()
        {
            base.LoadContent();
        }


     }

    public class MainGameScreen : GameplayScreen
    {
        public MainGameScreen()
            : base(null)
        {
        }
        public override void LoadContent()
        {
            base.LoadContent();
        }
        CreamXObject particle;
        CreamXSceneData data;
        public override void LoadGameData()
        {
            data=CreamXGameEngine.Instance.LoadScene("Content/Level1.cxscene");
            particle = data.GetObject("ParticleEffect");
            data.Camera.SetPosition(Vector2.Zero);
            particle.SetPosition(data.Camera.Size/2);
            base.LoadGameData();
            
            CreamXGameEngine.Instance.Enabled = true;
        }
        public override void HandleInput(GameTime gameTime, InputState input)
        {
            base.HandleInput(gameTime, input);
        }
        public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen)
        {
            base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen);
        }
        
        public override void Draw(GameTime gameTime)
        {
            ScreenManager.GraphicsDevice.Clear(Color.Black);
            base.Draw(gameTime);
        }
    }
}
